package org.hepeng.fabric.gateway.event;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Objects;


/**
 * @author he peng
 * @date 2022/3/30
 */

@ToString
@Setter
@Getter
public class CCEventDefinition {

    private String chaincode;

    private String channel;

    private String event;

    public CCEventDefinition(String chaincode, String channel, String event) {
        this.chaincode = chaincode;
        this.channel = channel;
        this.event = event;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof CCEventDefinition)) return false;
        CCEventDefinition that = (CCEventDefinition) o;
        return chaincode.equals(that.chaincode) &&
                channel.equals(that.channel) &&
                event.equals(that.event);
    }

    @Override
    public int hashCode() {
        return Objects.hash(chaincode, channel, event);
    }
}
